package 类和对象课堂练习.封装;

public class Zuoye032913 {
    private String name;

    public Zuoye032913(String name) {
        this.name = name;
    }
    public void print(Zuoye03291 p){
        System.out.println(name+"是一位全能飞行员");
        System.out.println("此时他正在准备开"+p.getName());
        if (p instanceof Zuoye032911){
            System.out.println("检查发射装置是否正常");
            ((Zuoye032911)p).print();
        }
        else if (p instanceof Zuoye032912){
            System.out.println("检查乘客是否都以入座");
            ((Zuoye032912)p).print();
        }
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
